<%--

    Copyright (C) 2008-2009 Cristian Olaru <colaru@gmail.com>
    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at
            http://www.apache.org/licenses/LICENSE-2.0
    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.
    
--%>

		<%@ include file="/common/taglibs.jsp"%>
		<div class="hidden">
			<form method="post" id="loginForm" action="<c:url value='/j_security_check'/>" onsubmit="saveUsername(this);return validateForm(this)">
				<input id="j_username" name="j_username" type="hidden" value=""/>
				<input id="j_password" name="j_password" type="hidden" value="" type="password"/>
			</form>
		</div>
		<div id="logo">
			<authz:authorize ifAnyGranted="ROLE_USER, ROLE_ADMIN">			      
				    <c:if test="${pageContext.request.remoteUser != null}">
			        	 <fmt:bundle basename="ApplicationResources"><fmt:message key="logo.status"/> <authz:authentication operation="fullName"/></fmt:bundle>!
			        </c:if>
					<a href="<c:url value='/logout.jsp'/>"><fmt:bundle basename="ApplicationResources"><fmt:message key="logo.logout"/></fmt:bundle></a>
			</authz:authorize>
			<authz:authorize ifAnyGranted="ROLE_ANONYMOUS">
				<input name="jive.login.successURL" value="/" type="hidden">
			    <input name="username" id="username" onKeyPress="javascript:checkEnterForLogin(event)" onfocus="swichForUser();" size="10" type="text" value="">
			    <input name="password" id="password" onKeyPress="javascript:checkEnterForLogin(event)" onfocus="swichForPass();" size="10" maxlength="16" value="" type="password">
			    
			    <c:out value="${confirmed}"></c:out>
				<a href="#" onclick="javascript:submitLoginForm();">				
					<c:choose>
						<c:when test="${param.r==1}">
							<span>(Re)Login</span> (session lost!)
						</c:when>
						<c:otherwise>
							<span>Login</span>
						</c:otherwise>
					</c:choose>
					<c:if test="${param.error != null}">
					    (try again!)
					</c:if>	
				</a>
			</authz:authorize>

			<br>
	       <span class="smalltext"> <c:out value="${usersNumber}"></c:out> <fmt:bundle basename="ApplicationResources"><fmt:message key="logo.members"/></fmt:bundle>	
		  <authz:authorize ifAnyGranted="ROLE_ANONYMOUS">
	     	<a href="editUserProfile.html"><fmt:bundle basename="ApplicationResources"><fmt:message key="logo.signup"/></fmt:bundle></a> <fmt:bundle basename="ApplicationResources"><fmt:message key="logo.topublish"/></fmt:bundle></span>
		  </authz:authorize>
		  <authz:authorize ifAnyGranted="ROLE_USER, ROLE_ADMIN">
			<fmt:bundle basename="ApplicationResources">
		  	 <fmt:message key="logo.visitors"> 
				<fmt:param>
					<c:out value="${visitators}"></c:out>
				</fmt:param>	
			</fmt:message> 	
			</fmt:bundle>
		  </authz:authorize>
		  <h1><a href="mainContent${application_theme}.html" title="<fmt:bundle basename="CustomizableResources"><fmt:message key="webapp.name"/></fmt:bundle>"><fmt:bundle basename="CustomizableResources"><fmt:message key="webapp.name"/></fmt:bundle><img src="images/badge_small.png" width="50" height="50" title="<fmt:bundle basename="CustomizableResources"><fmt:message key="webapp.version"/></fmt:bundle>" /></a></h1>
		  <h2 id="slogan"><fmt:bundle basename="CustomizableResources"><fmt:message key="webapp.logo"/></fmt:bundle></h2>
		  			
		  <ul id="antet" class="xmpl">	
			<c:forEach var="category" items="${allCategories}" varStatus="rowCounter">
				<li value="${category[1]}"><a href="getArticlesByCategory.html?categoryName=${category[0]}">${category[0]}</a> </li>
			</c:forEach>
		  </ul>
		
		  <script type="text/javascript">
					var eLi = $("#antet>li");
					var tLi = eLi.length;
					$.each(eLi,function(i,o){
						$(o).attr("title",$(o).text());
					});

					$.tagcloud.defaults.sizemin = 13;			
					$("#antet").tagcloud({height:70});
		  </script>
		</div>